package com.example.vue20220225.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.vue20220225.model.Power;
import com.example.vue20220225.model.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

public interface PowerDao extends BaseMapper<Power> {


    @Delete("delete from role_power where power_id in " +
            "(select power_id from power where parent_id = #{powerId} or power_id = #{powerId})")
    void deletePowerRole(Integer powerId);
    @Delete("delete from power where parent_id = #{powerId} or power_id = #{powerId}")
    void deleteFatherAndChild(Power power);
}
